package com.hudson.plugin.server.hibernateDB.domain.dao;

import com.hudson.plugin.server.hibernateDB.internal.domain.entity.CoverageEntity;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Richard
 * Date: 5/29/11
 * Time: 10:39 PM
 * To change this template use File | Settings | File Templates.
 */
public interface CoverageDAOInterface {
    // property constants
    String RD_FUNC_COV = "rdFuncCov";
    String QA_FUNC_COV = "qaFuncCov";
    String RD_CD_COV = "rdCdCov";
    String QA_CD_COV = "qaCdCov";
    String RD_LINE_COV = "rdLineCov";
    String QA_LINE_COV = "qaLineCov";

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void save(CoverageEntity transientInstance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void delete(CoverageEntity persistentInstance);

    CoverageEntity findById(Integer id);

    List findByExample(CoverageEntity instance);

    List findByProperty(String propertyName, Object value);

    List findByRdFuncCov(Object rdFuncCov);

    List findByQaFuncCov(Object qaFuncCov);

    List findByRdCdCov(Object rdCdCov);

    List findByQaCdCov(Object qaCdCov);

    List findByRdLineCov(Object rdLineCov);

    List findByQaLineCov(Object qaLineCov);

    List findAll();

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    CoverageEntity merge(CoverageEntity detachedInstance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void attachDirty(CoverageEntity instance);

    @Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    void attachClean(CoverageEntity instance);
}
